package com.example.springbootyczy.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 这是一个学生类，包括的属性有：
 * 学号：no
 * 姓名：name
 * 身份证号：idno
 * 手机号：phone
 * 性别：sex
 * 年龄：age
 * 专业ID：majorId
 * 班级ID：clazzId
 * 使用lombok分别实现get和set方法。
 */
@TableName(value = "student")
@Data
public class Student extends BaseEntity {
    //标记该属性在数据库表当中的意义
    @TableField(value = "no", exist = true)
    private String no;
    private String name;
    private String idno;
    private String phone;
    private String sex;
    private int age;
    private String pwd;
    @TableField(value = "major_id", exist = true)
    private String major;
    @TableField(value = "clazz_id", exist = true)
    private String clazz;

    @Override
    public String toString() {
        return "{" +
                "\"no\":\"" + no + '"' +
                ", \"name\":\"" + name + '"' +
                ", \"idno\":\"" + idno + '"' +
                ", \"phone\":\"" + phone + '"' +
                ", \"sex\":\"" + sex + '"' +
                ", \"age\":" + age +
                ", \"pwd\":\"" + pwd + '"' +
                ", \"major\":\"" + major + '"' +
                ", \"clazz\":\"" + clazz + '"' +
                "}";
    }
}
